#ifndef RIGID_BODY_H
#define RIGID_BODY_H


#include <stdlib.h>
#include <vector>
#include <GL/glut.h>
#include "linear.h"


using namespace std;
class BBox;
class RigidBody;
bool areColliding(MyVec3 cubePosition, float cubeSize,MyVec3 spherePosition, float sphereRadius);

class RigidBody{
      public:
            float size2;
             MyVec3 position;
             float mass;
             MyVec3 linMomentum;
             MyVec3 angMomentum;
             MyVec3 forceTotal;
             MyVec3 torque;
             MyMat3 ort; //Orientation
             MyVec3 angVelocity; //temporary testing variable 
             //MyMat3 inertiaTensor;
             void renderSelf();
             vector<MyVec3> getState();
             void setState(vector<MyVec3> state);
             vector<MyVec3> getDerivState();
             void clearForces();
             virtual void ODEify(float){};
             virtual void render(){}
             //virtual bool collide();
      
};

class SphereBody : public RigidBody{
      public:
             
             float radius;
             SphereBody(float r, float x, float y, float z, float m);
             MyMat3 inertiaTensor;
             void ODEify(float);
             void render();
             //bool collide();
};

class CubeBody : public RigidBody{
      public:
             SphereBody* shell;
             float size;
             vector<MyVec3> corners;
             CubeBody(float s, float x, float y, float z, float m);
             MyMat3 inertiaTensor;
             void ODEify(float);
             void render();
             //bool collide();
             
};

#endif

